package featuremodel.constraint;

import featuremodel.FeatureModelDef;
import featuremodel.method.RequireMethodSetUnbind;
import featuremodel.method.RequireMethodSetBind;
import skyblue.Constraint;
import skyblue.Strength;
import skyblue.Variable;

public class OptionalConstraint extends Constraint {
	private Variable parent;
	private Variable child;

	public OptionalConstraint(Variable child, Variable parent, Strength strength) {

		super(strength);
		this.constraintType = FeatureModelDef.OPTIONAL_CONSTRAINT;
		this.setParent(parent);
		this.setChild(child);
		getVariables().add(child);
		getVariables().add(parent);

		getMethods().add(new RequireMethodSetBind(parent));
		getMethods().add(new RequireMethodSetUnbind(child));
		

	}

	public void setParent(Variable parent) {
		this.parent = parent;
	}

	public Variable getParent() {
		return parent;
	}

	public void setChild(Variable child) {
		this.child = child;
	}

	public Variable getChild() {
		return child;
	}

}
